import React from 'react';
import ReactDOM from 'react-dom/client';
import './index.scss';
import App from './App';
import reportWebVitals from './reportWebVitals';

// 导入状态管理
import { Provider } from 'react-redux';
import store from './store';

// 导入全局的antd样式集合，可以直接导入，也可以再css中导入
import './index.scss'
// 导入路由管理
import {BrowserRouter as Router} from 'react-router-dom'
// 导入 中文语言包， Ant 本地化中文语言
import { ConfigProvider } from 'antd'
import zhCN from 'antd/locale/zh_CN'

const root = ReactDOM.createRoot(
  // document.getElementById('root') as HTMLElement
  document.getElementById('root') as HTMLDivElement //类型断言
);
root.render(
  // 全局提供消费的解决方案，来使用 中文语言包
  <ConfigProvider locale={zhCN}>
    <Provider store={store}>
      <Router>
        <App />
      </Router>
    </Provider>
  </ConfigProvider>
);

// If you want to start measuring performance in your app, pass a function
// to log results (for example: reportWebVitals(console.log))
// or send to an analytics endpoint. Learn more: https://bit.ly/CRA-vitals
reportWebVitals();
